package org.oslo.mule.transformer;

import org.mule.impl.RequestContext;
import org.mule.transformers.AbstractTransformer;
import org.mule.umo.UMOEventContext;
import org.mule.umo.transformer.TransformerException;
import org.oslo.domain.SearchInfo;

public class GeocoderTransformer extends AbstractTransformer {

	protected Object doTransform(Object payload, String encoding) throws TransformerException {
		SearchInfo search = (SearchInfo) payload;
		UMOEventContext context = RequestContext.getEventContext();
		context.getSession().setProperty("search-identifier", search.getSearchIdentifier());
		context.getMessage().setStringProperty("outputtype", "xml");
		context.getMessage().setStringProperty("googlekey", "ABQIAAAAC0PeXxh5ksYdX3woSTag7RT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSJmiLWAg10PFeX5alljXUYXaVKAw");
		return search.getConferenceLocation();
	}

}
